﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Edu.ZJ
{
    public partial class LoadingForm : Form
    {
        public LoadingForm()
        {
            InitializeComponent();
            
            this.BackColor = Color.White;
            this.TransparencyKey = Color.Transparent;
            this.panel1.BackColor = Color.Transparent;
        }

        public void SetText(string text)
        {
            if (this.InvokeRequired)
            {
                this.Invoke(new Action(() =>
                {
                    labTip.Text = text;
                }));
            }
            else
            {
                labTip.Text = text;
            }
        }

        public void CloseForm()
        {
            if (this.InvokeRequired)
            {
                this.Invoke(new Action(() =>
                {
                    this.Close();
                }));
            }
            else
            {
                this.Close();
            }
        }
    }
}
